// 关于文章的模块
import { reqGetArtCateList } from '@/api/article'
export default {
  state: {
    // 文章分类列表
    cateList: []
  },
  mutations: {
    // 设置文章分类列表的mutation
    setCateList (state, list) {
      state.cateList = list
    }
  },
  actions: {
    // 发送请求获取文章分类action
    async getCateList ({ commit }) {
      const { data } = await reqGetArtCateList()
      if (data.code === 0) {
        commit('setCateList', data.data)
      }
    }
  },
  getters: {},
  // 开启命名空间
  namespaced: true
}
